# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AnalyticsHub.V1.Model.DataExchange do
  @moduledoc """
  A data exchange is a container that lets you share data. Along with the descriptive information about the data exchange, it contains listings that reference shared datasets.

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the data exchange. The description must not contain Unicode non-characters as well as C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default value is an empty string. Max length: 2000 bytes.
  *   `discoveryType` (*type:* `String.t`, *default:* `nil`) - Optional. Type of discovery on the discovery page for all the listings under this exchange. Updating this field also updates (overwrites) the discovery_type field for all the listings under this exchange.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. Human-readable display name of the data exchange. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and must not start or end with spaces. Default value is an empty string. Max length: 63 bytes.
  *   `documentation` (*type:* `String.t`, *default:* `nil`) - Optional. Documentation describing the data exchange.
  *   `icon` (*type:* `String.t`, *default:* `nil`) - Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API only performs validation on size of the encoded data. Note: For byte fields, the content of the fields are base64-encoded (which increases the size of the data by 33-36%) when using JSON on the wire.
  *   `listingCount` (*type:* `integer()`, *default:* `nil`) - Output only. Number of listings contained in the data exchange.
  *   `logLinkedDatasetQueryUserEmail` (*type:* `boolean()`, *default:* `nil`) - Optional. By default, false. If true, the DataExchange has an email sharing mandate enabled.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the data exchange. e.g. `projects/myproject/locations/US/dataExchanges/123`.
  *   `primaryContact` (*type:* `String.t`, *default:* `nil`) - Optional. Email or URL of the primary point of contact of the data exchange. Max Length: 1000 bytes.
  *   `sharingEnvironmentConfig` (*type:* `GoogleApi.AnalyticsHub.V1.Model.SharingEnvironmentConfig.t`, *default:* `nil`) - Optional. Configurable data sharing environment option for a data exchange.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :discoveryType => String.t() | nil,
          :displayName => String.t() | nil,
          :documentation => String.t() | nil,
          :icon => String.t() | nil,
          :listingCount => integer() | nil,
          :logLinkedDatasetQueryUserEmail => boolean() | nil,
          :name => String.t() | nil,
          :primaryContact => String.t() | nil,
          :sharingEnvironmentConfig =>
            GoogleApi.AnalyticsHub.V1.Model.SharingEnvironmentConfig.t() | nil
        }

  field(:description)
  field(:discoveryType)
  field(:displayName)
  field(:documentation)
  field(:icon)
  field(:listingCount)
  field(:logLinkedDatasetQueryUserEmail)
  field(:name)
  field(:primaryContact)
  field(:sharingEnvironmentConfig, as: GoogleApi.AnalyticsHub.V1.Model.SharingEnvironmentConfig)
end

defimpl Poison.Decoder, for: GoogleApi.AnalyticsHub.V1.Model.DataExchange do
  def decode(value, options) do
    GoogleApi.AnalyticsHub.V1.Model.DataExchange.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AnalyticsHub.V1.Model.DataExchange do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
